uniform sampler2D tex;
uniform vec2 texelSize;

void main()
{
    vec4 c;
    c = texture2D(tex, gl_TexCoord[0].xy + vec2(-0.5, -0.5)*texelSize);
    c += texture2D(tex, gl_TexCoord[0].xy + vec2(0.5, -0.5)*texelSize);
    c += texture2D(tex, gl_TexCoord[0].xy + vec2(0.5, 0.5)*texelSize);
    c += texture2D(tex, gl_TexCoord[0].xy + vec2(-0.5, 0.5)*texelSize);
    c *= 0.25;

    gl_FragColor = c;
}